<template>
  <div class="precednce">
    <van-swipe :autoplay="3000" lazy-render>
      <van-swipe-item v-for="image in images" :key="image">
        <img :src="image" />
      </van-swipe-item>
    </van-swipe>
  </div>
  <h3>老板带着小姨子跑了</h3>
  <van-cell v-for="item in itemsb" :key="item.id"  @click="$router.push({path:'/goods_detail',query:{id:item.id}})">
    <template #title>
      <van-card num="9999+" tag="9999+" price="9999+.00" desc="小米官方授权传记" title="【小米10周年】首次公开小米历史上不为人知的创业故事。"
        thumb="https://www.pmdaniu.com/storages/124137/4fd65663c237204d6e2adfba9b23af2f-103297/images/%E9%A6%96%E9%A1%B5_1/p21.png" origin-price="188888.00" />
    </template>
  </van-cell>
  <van-empty image-size="100" description="没有更多了哦" />
</template>

<script setup>
import { ref } from 'vue';
import { getHomeData } from '../../../api/home'

const dizhi = 'https://www.pmdaniu.com/storages/124137/4fd65663c237204d6e2adfba9b23af2f-103297/images/%E5%8F%91%E7%8E%B0%E6%A0%B7%E5%BC%8F1/'
const images = ref([
   dizhi+'u616.jpg',
   dizhi+'u617.jpg',
   dizhi+'u618.jpg',
   dizhi+'u619.jpg',
   dizhi+'u616.jpg',
])
const itemsb = ref([])
async function foo(){
    const result=await getHomeData()
    const{items}=result
    itemsb.value.push(...items.list)
}
foo()
</script>

<style lang="less" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}

.precednce {
  margin-top: 50px;
}

h3 {
  text-align: center;
}

img {
  width: 100%;
  height: 100%;
}
</style>

